from django.db import models
from django.contrib.auth.models import User

# Create your models here.
class Event(models.Model):
    DISTANCE_METRICS = (
        ("mi",'Miles'),
        ("km",'Kilometers'),
    )
    
    name = models.CharField(max_length=100)
    description = models.TextField()
    date = models.DateField()
    time = models.TimeField()
    location = models.CharField(max_length=100)
    distance = models.DecimalField(max_digits=15, decimal_places=2)
    unit = models.CharField(max_length=2, choices=DISTANCE_METRICS, default="mi")
    owner = models.ForeignKey(User, related_name="owner")
    participants = models.ManyToManyField(User)
